import fetch from '@/utils/request'

export function fetchArea(query) {
  return fetch({
    url: '/api/crm/baseArea/tree',
    method: 'get',
    params: query
  })
}

export function fetchAll() {
  return fetch({
    url: '/api/crm/baseArea/list',
    method: 'get'
  })
}
export function addObj(obj) {
  return fetch({
    url: '/api/crm/baseArea/add',
    method: 'post',
    data: obj
  })
}

export function getObj(data) {
  return fetch({
    url: '/api/crm/baseArea/info',
    method: 'get',
    data: data
  })
}

export function delObj(data) {
  return fetch({
    url: '/api/crm/baseArea/delete',
    method: 'delete',
    data: data
  })
}

export function putObj(obj) {
  return fetch({
    url: '/api/crm/baseArea/update',
    method: 'put',
    data: obj
  })
}

export function getProvince(obj) {
  return fetch({
    url: '/api/crm/baseArea/province',
    method: 'post',
    data: obj
  })
}
